<?php
//----------------------------------------------------------------------------------------------------------
if (!$_GET['pass'] || $_GET['pass']!="trytoguess") exit("You have no permission to view this page");

    require_once('../config.inc.php');

    require_once($config['app_dir'] . '/classes/stockmailer.data.php');
	require_once($config['app_dir'] . '/includes/db.class.php');

    echo "<h2>GBP/USD Swing - Session 527</h2>";
	$sessionid = 527;
	$mtype = 4;
	
	class getMails extends objStockMailerModel {
		public $_db = false;
		
		public function __contruct(){
			$this->_db = objDataBase::GetInstance();
		
		}
	}
	
	$mails= new getMails();
	
	 
	

	echo "<b>MessageType = 1 :</b><br>";
   	$StockMailerModel = new objStockMailerModel();
	$data_mail1 = $mails->_db->handler->getAll("SELECT UserID FROM fa_mailer_mails WHERE MessageType=1 AND SessionID=".$sessionid);
	
	
   	$emails = $StockMailerModel->getEmailsArr(1, 2400203, 1);
	echo "<b>total  - ".count($emails)."</b><br>";

   	foreach($emails as $item) {
                  echo $item['id']." - ";
                  echo $item['email'];
				  if (in_array(array('UserID' => $item['id']), $data_mail1)) echo " - OK";
				  echo "<br>";
    }

   	echo "<br><br><br>";


   	echo "<b>MessageType = 4 :</b><br>";
   	$StockMailerModel1 = new objStockMailerModel();
	$data_mail4 = $mails->_db->handler->getAll("SELECT UserID FROM fa_mailer_mails WHERE MessageType=4 AND SessionID=".$sessionid);
   	$emails1 = $StockMailerModel1->getEmailsArr(4, 2400203, 1);
	echo "<b>total  - ".count($emails1)."</b><br>";

   	foreach($emails1 as $item) {
                  echo $item['id']." - ";
                  echo $item['email'];
				  if (in_array(array('UserID' => $item['id']), $data_mail4)) echo " - OK";
				  echo "<br>";
    }

   	echo "<br><br><br>";


   	echo "<b>MessageType = 3 (SMS email) :</b><br>";
   	$StockMailerModel1 = new objStockMailerModel();
	$data_mail3 = $mails->_db->handler->getAll("SELECT UserID FROM fa_mailer_mails WHERE MessageType=3 AND SessionID=".$sessionid);
   	$emails2 = $StockMailerModel->GetSMSEmailsArr(1, 2400203, 1);
    echo "<b>total  - ".count($emails2)."</b><br>";

    foreach($emails2 as $item) {
                  echo $item['id']." - ";
                  echo $item['email'];
				  if (in_array(array('UserID' => $item['id']), $data_mail3)) echo " - OK";
				  echo "<br>";
    }

   	echo "<br><br><br>";


   	echo "<b>MessageType = 5 (SMS direct) :</b><br>";
   	$StockMailerModel1 = new objStockMailerModel();
	$data_mail5 = $mails->_db->handler->getAll("SELECT UserID FROM fa_mailer_mails WHERE MessageType=5 AND SessionID=".$sessionid);
   	$emails3 = $StockMailerModel->GetSMSDirectArr(1, 2400203, 1);
    echo "<b>total  - ".count($emails3)."</b><br>";

    foreach($emails3 as $item) {
                  echo $item['id']." - ";
                  echo $item['email'];
				  if (in_array(array('UserID' => $item['id']), $data_mail5)) echo " - OK";
				  echo "<br>";
    }

   	echo "<br><br><br>";


?>
